<template>
	<view class="mainpage">
		<pageheader :setting="settingdata"></pageheader>
		<view class="box">
			<image src="../../static/img/sj.png" mode="aspectFill"></image>
			<view class="phone">已绑定手机号<text>{{mobile_text}}</text></view>
			<!-- <view class="metion">更换手机号请前往个人资料</view> -->
			<view class="changephone" @click="savemobile">更换手机号</view>
		</view>
	</view>
</template>

<script>
	var _this;
	export default {
		data() {
			return {
				settingdata: {
					name: '绑定手机',
					bgColor: '#fff',
					titleColor: '#000000',
					showNav: true,
					showTypes: 0,
					position: "bingdingphone"
				},
				mobile_text: '',
			}
		},
		onLoad(e) {
			_this = this
		},
		onShow() {
			_this.getInfo() 
		},
		methods: {
			getInfo() {
				if (uni.getStorageSync("token")) {
					_this.$api.get("material", {}).then(data => {
						console.log(data.mobile_text)
						_this.mobile_text = data.mobile_text
					});

				}
			},

			savemobile() {
				uni.navigateTo({
				  url: '/home/login/bingding'
				})
			},
			
		}
	}
</script>

<style lang="scss" scoped>
	.mainpage {
		height: 100vh;
		background-color: #F1F2F6;

		.box {
			display: flex;
			flex-direction: column;
			align-items: center;
			margin: 0 50rpx;

			image {
				margin-top: 144rpx;
				width: 136rpx;
				height: 136rpx;
				border-radius: 50%;
			}

			.phone {
				margin-top: 58rpx;
				color: #2C3240;
				font-size: 32rpx;
				font-weight: bold;

				text {
					margin-left: 20rpx;
				}
			}

			.metion {
				margin-top: 26rpx;
				color: #BAB8C8;
			}

			.changephone {
				margin-top: 188rpx;
				height: 88rpx;
				background: linear-gradient(86deg, #38BE8C, #05ADBB);
				border-radius: 44rpx;
				text-align: center;
				line-height: 88rpx;
				color: #FFFFFF;
				font-size: 30rpx;
				font-weight: bold;
				width: 649rpx;
			}
		}
	}
</style>
